<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions" 
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples">
  
  <process id="defaultHandlerProcess" isExecutable="true">

    <startEvent id="start" />

    <sequenceFlow sourceRef="start" targetRef="subProcess" />
    <subProcess id="subProcess">
      <startEvent id="subProcessStart" />
      
      <sequenceFlow sourceRef="subProcessStart" targetRef="activity" />
      <serviceTask id="activity" camunda:expression="${true}" />
      
      <sequenceFlow sourceRef="activity" targetRef="subProcessEnd" />
      <endEvent id="subProcessEnd" />
      
      <!-- compensation handler for "activity" -->
      <boundaryEvent id="compensateBoundaryEvt" attachedToRef="activity">
        <compensateEventDefinition />
      </boundaryEvent>
      <userTask id="compensationHandler" isForCompensation="true" />
      <association associationDirection="One" sourceRef="compensateBoundaryEvt" targetRef="compensationHandler" />
    </subProcess>    
    
    <sequenceFlow sourceRef="subProcess" targetRef="beforeCompensate" />
    <userTask id="beforeCompensate" />
    
    <sequenceFlow sourceRef="beforeCompensate" targetRef="throwCompensate" />
    <intermediateThrowEvent id="throwCompensate">
      <compensateEventDefinition  />
    </intermediateThrowEvent>
    
    <sequenceFlow sourceRef="throwCompensate" targetRef="end" />
    <endEvent id="end" />
    
  </process>

</definitions>
